package com.qiaofang.collectmanagebff.service.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";

    public static final String YYYY_MM_DD_T_HH_MM_SS_SSSZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";

   public static  final Logger logger = LoggerFactory.getLogger(DateUtils.class);

    /**
     * 格式化日期
     */
    public static String formatDate(Date date){
        String time = "";
        try {
            SimpleDateFormat fm = new SimpleDateFormat(YYYY_MM_DD_T_HH_MM_SS_SSSZ);
            time = fm.format(date);
        }catch(Exception e){
            logger.error("日期解析错误{}",e);
        }
        return time;
    }

    public static void main(String[] args) {
    }
}
